Skip to content

Add ssh-container example image - #10

Merged
bdevcich merged 1 commit into
masterfrom
ssh-container
Jul 28, 2025
Merged

Add ssh-container example image#10
bdevcich merged 1 commit into
masterfrom
ssh-container

Conversation

@bdevcich

Copy link
Copy Markdown
Contributor

Start with the README.md

Signed-off-by: Blake Devcich <blake.devcich@hpe.com>
@@ -0,0 +1,27 @@
apiVersion: nnf.cray.hpe.com/v1alpha7
kind: NnfContainerProfile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've forgotten how the uid/gid from the Workflow gets communicated to the user-container (oops). Do we have anything in here, maybe in the entrypoint.sh or somewhere else, where we confirm that the Workflow uid/gid matches the uid/gid baked into the image?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm clever enough to convince the admin to install my containerprofile which points at someone else's image, then that would be bad.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We run the container with a securityContext and set the UID/GID to the values from the workflow.

You will run into permissions errors when you try to start the container. On htx-1, I created a workflow as matt with my image:

ssh-svr Starting SSH container entrypoint script...
ssh-svr mpiuser
ssh-svr uid=1063(mpiuser) gid=100(users) groups=100(users)
ssh-svr total 16
ssh-svr drwxr-xr-x 1 1060 users  108 Jul 28 12:32 .
ssh-svr drwxr-xr-x 1 root root    21 Oct 12  2024 ..
ssh-svr -rw-r--r-- 1 1060 users  220 Mar 29  2024 .bash_logout
ssh-svr -rw-r--r-- 1 1060 users 3526 Mar 29  2024 .bashrc
ssh-svr -rw-r--r-- 1 1060 users  807 Mar 29  2024 .profile
ssh-svr drwxrwsrwt 3 root users  140 Jul 28 20:54 .ssh
ssh-svr -rw-r--r-- 1 1060 users   90 Oct 12  2024 .sshd_config
ssh-svr drwxr-xr-x 1 1060 users   64 Jul 28 15:27 ssh-session
ssh-svr total 8
ssh-svr drwxr-xr-x 1 1060 users  64 Jul 28 15:27 .
ssh-svr drwxr-xr-x 1 1060 users 108 Jul 28 12:32 ..
ssh-svr drwxr-xr-x 1 1060 users  81 Jul 28 15:27 keys
ssh-svr -rw-r--r-- 1 1060 users 747 Jul 28 15:27 keysmpiuser_key.pub
ssh-svr -rw-r--r-- 1 1060 users 167 Jul 28 15:27 sshd_config
ssh-svr /entrypoint.sh: 11: cannot create /home/mpiuser/ssh-session/env.sh: Permission denied

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for confirming.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And even if you got past this part, ssh most likely wouldn't work unless you baked in the same public key.

@bdevcich
bdevcich merged commit ead6690 into master Jul 28, 2025
4 of 5 checks passed
@bdevcich
bdevcich deleted the ssh-container branch July 28, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants